<?php if($sf_user->isAuthenticated()){ ?>
<div style="display: none;">
  <div id="fancyReportar" style="width: 450px;min-height: 200px;overflow:auto;">
    <form id="frmFancyReportar">
      <b>Reportar</b>
      <ul>
          <?php $c=0; ?>
          <?php foreach($abuses as $abuse){ ?>
          <li><input type="radio" name="radio" value="<?php echo $abuse->getId() ?>"
                     <?php if($c==0){ echo 'checked'; } ?> />
              <?php echo $abuse->getDescription() ?></li>
          <?php $c++; ?>
          <?php } ?>
      </ul>
      Mensaje: <br />
      <textarea id="message" cols="45" rows="5"></textarea><br /><br />
      <input type="button" value="Aceptar" onclick="ajaxReportAbuse()" />
    </form>
  </div>
</div>
<?php } ?>
<script type="text/javascript">
function ajaxReportAbuse(){
    var abuse_id = $('input[name=radio]:checked', '#frmFancyReportar').val();
    var mensaje = $("#frmFancyReportar #message").val();
    var article_id = $("#frmArticleShow #hdId").val();/* article hidden id, obtenido de article/showSuccess */
    $.ajax({
        type: "post",
        url: "<?php echo url_for('@ajaxReportAbuse') ?>",
        data: "abuse_id="+abuse_id+"&message="+mensaje+"&article_id="+article_id,
        success: function(html){
            alert("Reporte enviado");
            /* limpiamos los campos */
            $("#frmFancyReportar #message").val('');
            $.fancybox.close();
        }
    });
}
</script>